/**
 * @flow
 */

import React, { Component } from 'react';
import {
    StyleSheet,
    Text,
    View,
    TextInput,
    Image,
    Dimensions,
    TouchableOpacity,
    ScrollView
} from 'react-native';
import TomView from './TomView';

export default class Home extends Component {
    constructor(props){
        super(props);
    }
    
    static navigationOptions = {
        headerTitle:
            <View style={{height:1000,backgroundColor:'rgba(255,96,0,1.0)',flexDirection:'row',alignItems:'center',justifyContent:'space-between',width:Dimensions.get('window').width}}>
                <Text style={{color:'white',marginLeft:10}}>广州</Text>
                <TextInput style={{width:Dimensions.get('window').width*0.6,height:30,backgroundColor:'white',borderRadius:15,padding:0,textAlign:'center'}} underlineColorAndroid='transparent' placeholder='输入商家、品类、商圈' onSubmitEditing={()=>{Home.ss()}}/>
                <View style={{flexDirection:'row',marginRight:10}}>
                    <TouchableOpacity onPress={() => {Home.ss()}}><Image source={require('../image/icon_homepage_message.png')} style={{width:25,height:25,marginRight:5}}/></TouchableOpacity>
                    <TouchableOpacity><Image source={require('../image/icon_homepage_scan.png')} style={{width:25,height:25}}/></TouchableOpacity>
                </View>
            </View>
    }
    
    static ss (){
        alert('22rr');
    }
    
    render() {
        return (
            <ScrollView>
                <TomView/>
            </ScrollView>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: '#F5FCFF',
    }
});
